package com.beiing.tianshuai.tianshuai.message.presenter;

import com.beiing.tianshuai.tianshuai.base.BasePresenter;
import com.beiing.tianshuai.tianshuai.entity.CodeBean;
import com.beiing.tianshuai.tianshuai.message.model.GroupDelMembersModel;
import com.beiing.tianshuai.tianshuai.message.model.GroupDelMembersModelImpl;
import com.beiing.tianshuai.tianshuai.message.view.GroupDelMembersViewImpl;

/**
 * Created by Jinni on 2017/9/24 0024.
 */

public class GroupDelMembersPresenter extends BasePresenter implements
        GroupDelMembersPresenterImpl, GroupDelMembersModel.OnRequestListener {

    private GroupDelMembersViewImpl mView;
    private GroupDelMembersModelImpl mModel;

    public GroupDelMembersPresenter(GroupDelMembersViewImpl view) {
        mView = view;
        mModel = new GroupDelMembersModel(this);
    }

    @Override
    public void getGroupDelMembersResult(String uid, String toUid, String gid, String groupId) {
        mView.showProgress();
        mModel.getGroupDelMembersResult(uid, toUid, gid, groupId);
    }

    @Override
    public void onSuccess(CodeBean bean) {
        mView.hideProgress();
        mView.onRequestSuccess(bean);
    }

    @Override
    public void onError(Throwable throwable) {
        mView.hideProgress();
        mView.onRequestFailed(throwable);
    }
}
